<?php
include("./API.php");
include("../config.php");
tongji("qun_shut_list");
$hh=$_GET["hh"]?:"\n";//换行符号(默认\n)
$url="https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_shutup";
$data='gc='.$_GET["group"].'&bkn='.getGTK($_GET["skey"]).'';
$return_content=http_post_data($url, $data);
$result=preg_match_all('/{"t":(.*?),"nick":"(.*?)","uin":(.*?)}/',$return_content,$arr);
$pst= json_decode($return_content);
$hw_id=$pst->ec;
if($hw_id==0){
if($result!="0"){
echo "".$web["ming"]."API♧QQ群禁言列表".$hh."";
echo "━━━━━━━━━".$hh."";
for ($i=0; $i <$result ; $i++){
$aa=$arr[2][$i];
$str=str_replace("&nbsp;"," ","".$aa."");
$bb=$arr[1][$i];
$cc=$arr[3][$i];
echo ($i+1)."：".unescape($str)."-".$cc."-".$bb."秒".$hh."";
}
echo "共有".$result."人被禁言".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}
if($result=="0"){
echo "".$web["ming"]."API♧QQ群禁言列表".$hh."";
echo "━━━━━━━━━".$hh."";
echo "没有人被禁言".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}
}
if($hw_id!=0){
echo "".$web["ming"]."API♧QQ群禁言列表".$hh."";
echo "━━━━━━━━━".$hh."";
echo "参数错误".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}
function escape($str) {
  return str_replace('\\', '%', substr(json_encode($str), 1, -1));
}
function unescape($str) {
  return json_decode('"'.str_replace('%', '\\', $str).'"');
}

function getGTK($skey){
$len = strlen($skey);
$hash = 5381;
for ($i = 0; $i < $len; $i++) {
$hash += ($hash << 5 & 2147483647) + ord($skey[$i]) & 2147483647;
$hash &= 2147483647;
}
return $hash & 2147483647;
}

function http_post_data($url, $data_string) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(
	"Content-Type: application/x-www-form-urlencoded",
		"Content-Length: " . strlen($data_string),
		"Cookie: p_uin=o".$_GET["uin"]."; uin=o".$_GET["uin"]."; skey=".$_GET["skey"]."; p_skey=".$_GET["pskey"]
		));
	ob_start();
	curl_exec($ch);
	$return_content = ob_get_contents();
	ob_end_clean();
	return $return_content;
}
